/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package opener;

import org.jfree.data.xy.*;

public class XYZArrayDataset extends AbstractXYZDataset {

    double[][] data;
    double[] timedelays;
    double[] wavelength;
    int rowCount = 0;
    int columnCount = 0;

    public XYZArrayDataset(double[][] data, double[] timedelays, double[] wavelength) {
        this.data = data;
        this.timedelays = timedelays;
        this.wavelength = wavelength;
        rowCount = data.length;
        columnCount = data[0].length;
    }

    @Override
    public int getSeriesCount() {
        return 1;
    }

    public Comparable getSeriesKey(int series) {
        return "serie";
    }

    public int getItemCount(int series) {
        return rowCount * columnCount;
    }

    public double getXValue(int series, int item) {
        return wavelength[(int) (item / columnCount)];
    }

    public double getYValue(int series, int item) {
        return item % columnCount;
       // return timedelays[item % columnCount];
    }

    public double getZValue(int series, int item) {
        return data[(int) (item / columnCount)][item % columnCount];
    }

    public Number getX(int series, int item) {
        return wavelength[(int) (item / columnCount)];
    }

    public Number getY(int series, int item) {
        return (int)(item % columnCount);
      //  return timedelays[item % columnCount];
    }

    public Number getZ(int series, int item) {
        return new Double(data[(int) (item / columnCount)][item % columnCount]);
    }
}
